package com.job.springsea.work0709;

import java.util.Scanner;

/**
 * @author 于春海
 * @version 1.0
 * @since 2022-07-09 20:48:13
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("你想要了解什么? 1:普通人 2:学生 3:高中生 4:大学生");
        String choose=sc.next();
//        if("1".equals(choose)){
//            Person person =new Person();
//            person.eat();
//        }else if("2".equals(choose)){
//            Student student=new Student();
//            student.study();
//        }else if("3".equals(choose)){
//            HighSchoolStudent highSchoolStudent=new HighSchoolStudent();
//            highSchoolStudent.DoQuestion();
//        }else if("4".equals(choose)){
//            CollegeStudent collegeStudent=new CollegeStudent();
//        }
        Person person = null;
        person=chooseSort(person,choose);
        person.eat();
        person.sleep();
    }
    public static Person chooseSort(Person person, String choose){
        if("1".equals(choose)){
            person =new Person();
         }else if("2".equals(choose)){
             person =new Student();
        }else if("3".equals(choose)){
            person=new HighSchoolStudent();
        }else if("4".equals(choose)){
             person=new CollegeStudent();
         }
        return person;
    }

}